<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<LINK rel="Bookmark" href="/favicon.ico" >
<LINK rel="Shortcut Icon" href="/favicon.ico" />
<!--[if lt IE 9]>
<script type="text/javascript" src="__PUBLIC__/lib/html5.js"></script>
<script type="text/javascript" src="__PUBLIC__/lib/respond.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/lib/PIE_IE678.js"></script>
<![endif]-->
<link href="__PUBLIC__/css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="__PUBLIC__/css/H-ui.admin.css" rel="stylesheet" type="text/css" />
<link href="__PUBLIC__/css/style.css" rel="stylesheet" type="text/css" />
<link href="__PUBLIC__/lib/Hui-iconfont/1.0.6/iconfont.css" rel="stylesheet" type="text/css" />
<link href="Tpl/Admin/common/form.css" rel="stylesheet" type="text/css" />
<!--[if IE 6]>
<script type="text/javascript" src="__PUBLIC__/lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title>家庭成员列表</title>
</head>
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span>家庭管理<span class="c-gray en">&gt;</span> 家庭成员列表 <a class="btn btn-success radius r mr-20" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="pd-20">
	<div class="text-c roomInfo">
		<h2></h2>
		<input type="hidden" value="" name="room_id">
	</div>
	<div class="cl pd-5 bg-1 bk-gray mt-20"> <span class="l"><a href="javascript:;" onclick="datadel()" class="btn btn-danger radius familyDelBat"><i class="Hui-iconfont">&#xe6e2;</i> 批量删除</a> <a href="javascript:;" onclick="member_add('添加家庭成员','{:U('familyMember/create')}','800','500',this)" class="btn btn-primary radius addmember"><i class="Hui-iconfont">&#xe600;</i> 添加家庭成员</a></span> <!-- <span class="r">共有数据：<strong>54</strong> 条</span> --> </div>
	<table class="table table-border table-bordered table-bg" id="familymemberTable">
		<thead>
			<tr>
				<th scope="col" colspan="11">成员列表</th>
			</tr>
			<tr class="text-c">
				<th width="25"><input type="checkbox" name="" value=""></th>
				<th width="40">ID</th>
				<th width="150">客户编号</th>
				<th width="90">姓名</th>
				<th width="150">性别</th>
				<th width="150">手机号</th>
				<th width="130">身份证</th>
				<th width="100">身份</th>
				<th width="100">称谓</th>
				<th width="100">状态</th>
				<th width="100">操作</th>
			</tr>
		</thead>
		<tbody>
			
		</tbody>
	</table>
</div>
<script type="text/javascript" src="__PUBLIC__/lib/jquery/1.9.1/jquery.min.js"></script>  
<script type="text/javascript" src="__PUBLIC__/lib/layer/2.1/layer.js"></script> 
<script type="text/javascript" src="__PUBLIC__/lib/laypage/1.2/laypage.js"></script> 
<script type="text/javascript" src="__PUBLIC__/lib/My97DatePicker/WdatePicker.js"></script> 
<script type="text/javascript" src="__PUBLIC__/lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/H-ui.js"></script> 
<script type="text/javascript" src="__PUBLIC__/js/H-ui.admin.js"></script> 
<script type="text/javascript" src="__PUBLIC__/js/getUrl.js"></script> 
<script type="text/javascript" src="Tpl/Admin/common/familymember/table.js"></script> 
<script type="text/javascript" src="Tpl/Admin/common/family/getRoom.js"></script> 
<script type="text/javascript" src="Tpl/Admin/common/familymember/dataDel.js"></script>
<script type="text/javascript">
/*
	参数解释：
	title	标题
	url		请求的url
	id		需要操作的数据id
	w		弹出层宽度（缺省调默认值）
	h		弹出层高度（缺省调默认值）
*/

$(function(){
	var familyId=$.getUrlVar('familyId');
	if(familyId){
		$(".addmember").attr("uid",familyId);
	}else{
		$(".addmember").hide();
	}
	

})
/*成员-增加*/
function member_add(title,url,w,h,obj){
		var uid=$(obj).attr("uid");
		url=url+'&familyId='+uid;
		var index=layer.open({
			type: 2,
			area: ['700px', '500px'],
			fix: false, //不固定
			maxmin: true,
			shade:0.4,
			title: title,
			content:url,
			cancel:function(){
                // 关闭按钮后重绘表格
                $("#familymemberTable").DataTable().draw();
			}
		});
}
// 家庭成员信息修改
$(document).on("click",".familyEdit",function(){
	var customerId=$(this).attr("uid");
	var familyId=$.getUrlVar('familyId');
	layer.open({
		type: 2,
		area: ['600px', '500px'],
		fix: false, //不固定
		maxmin: true,
		shade:0.4,
		title: "成员编辑",
		content:'/index.php?m=Admin&c=FamilyMember&a=modify'+'&customerId='+customerId+'&familyId='+familyId,
	});
});

// 设为户主
$(document).on("click",".prefixBtn",function(){
	var customerId=$(this).attr("uid");
	var familyId=$.getUrlVar('familyId');
	prefixAjax(customerId,familyId);
});
// 设为户主ajax
function prefixAjax(customerId,familyId){
	$.post("/index.php?m=Admin&c=FamilyMember&a=update",{family_id:familyId,customer_id:customerId,prefix:'户主'},function(data){
		if(data.stat==1){
			layer.msg('操作成功!', {icon: 6,time:1000});
			$("#familymemberTable").DataTable().draw();
		}else{
			layer.msg('操作失败!', {icon: 6,time:1000});
		}
	});
}
</script>
</body>
</html>